// 对排序数组重新排序，使偶数位置上的数是奇数位置上的两倍
// e.g., 1 2 3 5 6 8 10 16 -> 1 2 3 6 5 10 8 16

#include <iostream>
#include <vector>
using namespace std;

bool get_res(vector<int>& v) {
    if (v.size() <= 1) {
        return false;
    }
    int slow = 0;
    int fast = 0;
    while (fast < v.size()) {
        while (fast < v.size() && v[fast] != v[slow] * 2) {
            fast++;
        }
        if (fast != slow + 1) {
            int tmp = v[slow + 1];
            v[slow + 1] = v[fast];
            v[fast] = tmp;
        }
        slow += 2;
        fast = slow + 1;
    }
    return slow >= v.size();
}

int main()
{
    vector<int> v = {1, 2, 3, 4, 5, 6, 7, 8, 10, 14};
    cout << get_res(v) << endl;
    
    return 0;
}
